package com.school.revervationSys.controller;

import com.school.revervationSys.service.MenuService;
import com.school.revervationSys.utils.BaseResponse;
import com.school.revervationSys.utils.ResultUtils;
import com.school.revervationSys.vo.MenuVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/menuList")
    public BaseResponse menuList(@Param("roleCode")String roleCode){

        List<MenuVo> menuVos = menuService.menuList(roleCode);

        return ResultUtils.success(menuVos);

    }

}
